//
//  UPlatformIOS.cpp
//  UltraStarDeluxeIOS
//
//  Created by 李 杰军 on 12-7-15.
//  Copyright (c) 2012年 DoReiMi. All rights reserved.
//

#include <iostream>
#include "UPlatformIOS.h"

TPlatform* Platform = NULL;

std::string TPlatformIOS::GetApplicationSupportPath()
{
    /*
    NSString* rootPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex: 0];
    NSString* appSupportPath = [rootPath stringByAppendingPathComponent:@"UltraStarDeluxeIOS"];
    std::string retStr = [appSupportPath cStringUsingEncoding:NSUTF8StringEncoding];
     */
    NSString* resourceDirectory = [[[NSBundle mainBundle] resourcePath]
                                stringByAppendingString:@"/resource/"];
    
    std::string retStr = [resourceDirectory cStringUsingEncoding:NSUTF8StringEncoding];

    return retStr;
}

std::string TPlatformIOS::GetGameSharedPath()
{
    return GetApplicationSupportPath();
}

std::string TPlatformIOS::GetGameUserPath()
{
    return GetApplicationSupportPath();
}
